HDR: Replace expand gamut toggle with multi-mode gamut selection#18676
Merged
LibretroAdmin merged 1 commit intolibretro:masterfrom Feb 2, 2026
Merged
Conversation
Change the HDR expand gamut setting from a boolean on/off to a multi-option uint supporting four colour gamut modes: - ACCURATE (0): Standard Rec.709 to Rec.2020 conversion - EXPANDED (1): Microsoft expanded gamut for enhanced saturation - WIDE (2): Rec.709 to Rec.2020 then to DCI-P3 - SUPER (3): Direct passthrough (no colour space conversion) Refactor HDR shader pipeline across D3D11, D3D12 and Vulkan to separate colour space conversion (To2020) from inverse tonemapping (HDR) and PQ encoding (HDR10), enabling each gamut mode to be applied at the correct stage. Add DCI-P3 colour matrix (k2020toP3). Rework scanline processing to operate in gamma 2.4 signal domain with a dedicated LinearToSignal function, and tune CRT scanline parameters (max 0.70->0.90, attack 0.30->0.60). Update gamma from 2.2 to 2.22 for more accurate sRGB decoding. Update menu, configuration, msg_hash, video driver interface, thread wrapper, and slang reflection to use unsigned type throughout. Rebuild SPIR-V shader binaries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
To2020), inverse tonemapping (HDR), and PQ encoding (HDR10) into distinct stages across D3D11, D3D12, and Vulkan shaders (both HLSL and GLSL), adding the DCI-P3 colour matrix (k2020toP3) for the new WIDE modeLinearToSignalfunction, with tuned CRT scanline parameters (max increased from 0.70 to 0.90, attack from 0.30 to 0.60) and corrected sRGB decode gamma (2.2→2.22)expand_gamutfield is changed frombool/floattounsigned intacross the video driver interface, D3D11/D3D12/Vulkan drivers, shader reflection, thread wrapper, configuration, and menu system — with a new custom string representation function and enum values for the four modeshdr.frag.incandhdr_tonemap.frag.inc